package com.redijedi.tapestry;

import java.util.Collection;

/**
 * @author torr
 * 
 */
public interface ITreeNodeModel<T> extends IVisitable {

	/**
	 * Returns this node instance's parent node instance. May return null.
	 * 
	 * @return
	 */
	abstract ITreeNodeModel<T> getParent();

	/**
	 * Returns this node instance's children node instances. May not return
	 * null. Will always return a collection of ITreeNode instances. The
	 * collection may be empty, however.
	 * 
	 * @return
	 */
	abstract Collection<ITreeNodeModel<T>> getChildren();

	/**
	 * Returns the user defined value object associated with this node.
	 * 
	 * @return
	 */
	abstract T getValue();

	/**
	 * Determines whether or not to display the value property in the tree. If
	 * yes the tree will use the value object's toString() method to return a
	 * string for presentation. The presentation of a leaf will usually be
	 * overridden by the nested elements, so this is false by default.
	 * 
	 * @return
	 */
	abstract boolean display();

}
